#pragma once
#include <d3d9.h>
#include <d3dx9.h>

class GraphicRender
{
private:
	LPDIRECT3DDEVICE9 _d3ddev;
	LPDIRECT3D9 _d3d;
	LPD3DXSPRITE _sprite;
	HWND _hWnd;
	int _width;
	int _height;
public:
	bool InitD3D();
	GraphicRender(HWND, int, int);
	~GraphicRender(void);
	void Begin();
	void End();
	void DrawTexture(LPDIRECT3DTEXTURE9 texture, D3DXVECTOR2 postion, D3DCOLOR color);
	void DrawTexture(LPDIRECT3DTEXTURE9 texture, RECT source, D3DXVECTOR2 postion, D3DCOLOR color);
	void DrawString(char* str);
	void DrawSurface();
	LPDIRECT3DDEVICE9 GetDevice();
};

